package com.gisocn.onemap.ui.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import butterknife.internal.Utils;
import com.gisocn.onemap.interfaces.OnItemClickListener;
import com.gisocn.onemap.model.LayerInfoBean;
import com.gisocn.onemap.sgzx.R;
import java.util.ArrayList;

/* loaded from: classes2.dex */
public class QueryStatisticsPopupAdapter extends RecyclerView.Adapter<ViewHolder> {
    ArrayList<LayerInfoBean> list;
    private OnItemClickListener onItemClickListener = null;

    /* loaded from: classes2.dex */
    public class ViewHolder_ViewBinding implements Unbinder {
        private ViewHolder target;

        public ViewHolder_ViewBinding(ViewHolder viewHolder, View view) {
            this.target = viewHolder;
            viewHolder.tvName = (TextView) Utils.findRequiredViewAsType(view, R.id.tv_name, "field 'tvName'", TextView.class);
            viewHolder.viewLine = Utils.findRequiredView(view, R.id.view_line, "field 'viewLine'");
        }

        @Override // butterknife.Unbinder
        public void unbind() {
            ViewHolder viewHolder = this.target;
            if (viewHolder == null) {
                throw new IllegalStateException("Bindings already cleared.");
            }
            this.target = null;
            viewHolder.tvName = null;
            viewHolder.viewLine = null;
        }
    }

    public QueryStatisticsPopupAdapter(ArrayList<LayerInfoBean> arrayList) {
        this.list = arrayList;
    }

    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_querystatistics_grouplayer, viewGroup, false));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public void onBindViewHolder(ViewHolder viewHolder, final int i) {
        viewHolder.itemView.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.adapter.QueryStatisticsPopupAdapter.1
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                if (QueryStatisticsPopupAdapter.this.onItemClickListener != null) {
                    QueryStatisticsPopupAdapter.this.onItemClickListener.onItemClick(view, i);
                }
            }
        });
        viewHolder.tvName.setText(this.list.get(i).getName());
        if (i == this.list.size()) {
            viewHolder.viewLine.setVisibility(8);
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public int getItemCount() {
        return this.list.size();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes2.dex */
    public static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.tv_name)
        TextView tvName;
        @BindView(R.id.view_line)
        View viewLine;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
